home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / p_aa4re / bb212src / bbauxmw.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-12-26  |  2.5 KB  |  82 lines

  1. (*===========================================================================*)
  2. (* Monitor window write                                                      *)
  3. (*                                                                           *)
  4. (*   Copyright 1988, 1989 by H. Roy Engehausen.  All rights reserved.        *)
  5. (*   This software may be freely distributed and used, but it may not        *)
  6. (*   under any circumstances be sold by anyone other than the author.        *)
  7. (*   It may be distributed by a commercial company as long as it is          *)
  8. (*   for no cost.                                                            *)
  9. (*                                                                           *)
  10. (*===========================================================================*)
  11.  
  12. (*===========================================================================*)
  13. (* Write data to monitor window                                              *)
  14. (*===========================================================================*)
  15.  
  16. PROCEDURE monitor_window_write(in_ptr     : str_mixed_ptr;
  17.                                prefix_id  : BOOLEAN;
  18.                                time_stamp : BOOLEAN);
  19.  
  20.   VAR
  21.     i          : WORD;
  22.     p_str      : STRING[9];
  23.     save_color : BYTE;
  24.  
  25.   BEGIN;
  26.  
  27.     IF time_stamp THEN
  28.       BEGIN;
  29.         STR(today_time.sec:2, p_str);
  30.         IF p_str[1] = ' ' THEN
  31.           p_str[1] := '0';
  32.         p_str := COPY(todays_date_time, 8, 4) + p_str + ':';
  33.       END
  34.     ELSE
  35.       p_str := '';
  36.  
  37.     IF prefix_id THEN
  38.       p_str := p_str + t_str;
  39.  
  40.     save_color          := active_tcb^.w_color;
  41.     active_tcb^.w_color := m_color;
  42.  
  43.     WITH in_ptr^ DO
  44.       WHILE long_length > 0 DO
  45.         BEGIN;
  46.  
  47.           IF long_length <= 255 THEN
  48.             BEGIN;
  49.               window_write(p_str, str_data);
  50.               long_length := 0;
  51.               str_data    := '';
  52.               active_tcb^.w_color := save_color;
  53.               EXIT;
  54.             END;
  55.  
  56.           i := 255;
  57.  
  58.           WHILE (i > 1) AND (str_data[i] <> cr) DO
  59.             DEC(i);
  60.  
  61.           IF i < 2 THEN
  62.             BEGIN;
  63.               i := (80 * 3) - LENGTH(p_str);
  64.               IF i > long_length THEN
  65.                 i := long_length;
  66.             END;
  67.  
  68.           window_write(p_str, substr(str_data, 1, i-1));
  69.  
  70.           IF long_length <= (i + 1) THEN
  71.             EXIT;
  72.  
  73.           in_ptr^ := l_substr(in_ptr, i +1, 0)^;
  74.  
  75.           p_str := '';
  76.  
  77.         END;
  78.  
  79.     active_tcb^.w_color := save_color;
  80.  
  81.   END;
  82.